#include <vector>
#include <set>
#include <iostream>
#include <unordered_map>
#include <numeric>

using namespace std;

bool detectCapital(char ch){
    if(ch >= 65 && ch <= 90){
        return true;
    }else{
        return false;
    }
}

bool detectCapitalUse(string word) {
    if(word.size() < 2){
        return true;
    }
    if(detectCapital(word[0])){
        int j = detectCapital(word[1]);
        for(int i = 2; i < word.size(); i++){
            if(j != detectCapital(word[i])){
                return false;
            }
        }
    }else{
        for(int i = 1; i < word.size(); i++){
            if(detectCapital(word[i])){
                return false;
            }
        }
    }
    return true;
}

int main(){
    string word = "FlaG";
    if(detectCapitalUse(word)){
        cout << "true" << endl;
    }else{
        cout << "false" << endl;
    }
    return 0;
}